package com.lbs.demo.services;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 读取config.properties 配置文件
 * @author Administrator
 *
 */
public class ConfigParser {
    private static Properties p = new Properties();
    static {
        InputStream is = null;
        try {
            is = ConfigParser.class.getClassLoader().getResourceAsStream("Config.properties");
            if(is!=null){
                p.load(is);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }finally{
            if(is!=null){
                try {
                    is.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    //
    public static String getProperty(String key){
        return p.getProperty(key);
    }
}